package indi.caspar.algorithms.sort;

/**
 * Created by casparhuan on 2017/6/17.
 */
public class SelectSorts {

    public static void sort(Comparable[] a){
        for (int i = 0; i < a.length ; i++) {
            int min = i ;
            for (int j = min + 1; j < a.length; j++) {
                if (SortsAlgUtil.less(a[i],a[min])){
                    min = j;
                }
            }
            SortsAlgUtil.exch(a,i,min);
        }
    }
}
